ITEMLIST ------------------------------------------------------------------- Written by David Stroud 75165,421 11/13/93 (707) 763-4728 ------------------------------------------------------------------- INCLUDED IN THE ZIP DIRECTORY: ------------------------------------------------------------------- (*)ITEMLIST.C The main Windows C module (*)ITEMLIST.H The public exports and manifest constants README.TXT The file you are reading right now ITEMTEST.MAK Visual C++ files for TESTING ITEMLIST ITEMTEST.C | | | ITEMTEST.RC | | | RESOURCE.H | | | ITEMTEST.DEF | | | (*) These are the only two files you will need to include to use item list in your program. ------------------------------------------------------------------- ABSTRACT ------------------------------------------------------------------- ITEMLIST is a standalone, independent set of calls that provide an application a method to manage a last file loaded list facility. It uses a dynamically allocated list of item names with which to manage Windows menu calls. The module can be included in any application that requires managing 'last called' lists and is particularly useful when dealing with documents, files, and data sets. ------------------------------------------------------------------- EXAMPLE USAGE: ------------------------------------------------------------------- The best way to understand how ITEMLIST can be called is to compile and run the ITEMTEST program. But here are the basics: To initialize, ItemListInit must be called to set the following parameters: szDefaultDir = If you are using filenames, this is the name of the directory that will be trimmed out of the filename when it is added. This can be suppressed, and is ignored by passing a "" (zero length string). uMaxItems = The number of items to be stacked. Memory is allocated based on this value. uSubMenu = The sub menu to be appended to. Typical usage for a 'last file loaded': ItemListInit ("C:\MYDIR", 5, 0); ItemListLoad ( GetMenu(hWndMain), "MY.INI"); .... ItemListAdd ( GetMenu(hWndMain), "THISFILE.TXT"); .... .... ItemListSave ( GetMenu(hWndMain), "MY.INI"); ItemListCleanup(); ------------------------------------------------------------------- CAVEATS AND CLOSING REMARKS ------------------------------------------------------------------- Remember, it is up to you to do the following: 1. Initialize... 2. Load defaults from your INI file... 3. Add items...they always 'rise to the top' avoiding explicit dups 4. Remove items... 5. Save defaults to your INI file 6. CLEAN UP MEMORY This module was written and compiled using Microsoft Visual C++ 1.0.